<template>
  <div>
    <h2>我的总资产：{{ moneyCount }} 元</h2>
    <input
      type="checkbox"
      :checked="moneyCount >= 10000 ? true : false"
    />目前是否是有钱人
    <h2>目前状态：{{ moneyCount >= 10000 ? '有钱人' : '穷人' }}</h2>
    <button @click="eat">吃饭花了100</button>
    <button @click="moneyCount -= 60">洗脚花了60</button>
    <button @click="moneyCount -= 1000">约会花了1000</button>
    <button @click="moneyCount += 500">送外卖赚了500</button>
  </div>
</template>

<script>
export default {
  name: 'on-component',
  data() {
    return {
      moneyCount: 10000,
    }
  },
  methods: {
    eat() {
      this.moneyCount -= 100
    },
  },
}
</script>

<style></style>
